using System;
using System.Reflection;
using System.Collections.Generic;
using System.Text;

namespace Crainiate.Data.Persistence.Providers
{
    public abstract class Context
    {
        //Proprty variables
        private string _prefix;

        public Context()
        {
            Prefix = string.Empty;
        }

        public virtual string Prefix
        {
            get
            {
                return _prefix;
            }
            set
            {
                _prefix = value;
            }
        }

        public abstract Concurrency CreateConcurrency();
        public abstract Command CreateCommand();
        public abstract Formatter CreateFormatter();

        public virtual IPersistable CreatePersistable(Type type)
        {
            IPersistable persistable = (IPersistable) Activator.CreateInstance(type);

            return persistable;
        }
    }
}
